package com.irdstudio.bsp.console.api.rest;

import java.util.List;

import com.irdstudio.bsp.console.service.vo.PluginCountersignConfVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.irdstudio.bsp.console.service.facade.PluginCountersignConfService;
import com.irdstudio.sdk.beans.core.vo.ResponseData;
import com.irdstudio.sdk.ssm.web.AbstractController;

@RestController
@RequestMapping("/api")
public class PluginCountersignConfController extends AbstractController  {
	
	@Autowired
	@Qualifier("pluginCountersignConfServiceImpl")
	private PluginCountersignConfService pluginCountersignConfService;

	
	/**
	 * 列表数据查询
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value="/plugin/countersign/confs", method=RequestMethod.POST)
	public @ResponseBody ResponseData<List<PluginCountersignConfVO>> queryPluginCountersignConfAll(
			PluginCountersignConfVO vo) {		
		List<PluginCountersignConfVO> outputVo = pluginCountersignConfService.queryAllOwner(vo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键查询详情
	 * @return
	 */
	@RequestMapping(value="/plugin/countersign/conf/{pluginConfId}", method=RequestMethod.GET)
	public @ResponseBody ResponseData<PluginCountersignConfVO> queryByPk(@PathVariable("pluginConfId") String pluginConfId) {		
		PluginCountersignConfVO inVo = new PluginCountersignConfVO();
				inVo.setPluginConfId(pluginConfId);
		PluginCountersignConfVO outputVo = pluginCountersignConfService.queryByPk(inVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键删除信息
	 * @param pluginCountersignConf
	 * @return
	 */
	@RequestMapping(value="/plugin/countersign/conf", method=RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody PluginCountersignConfVO inPluginCountersignConfVo) {		
		int outputVo = pluginCountersignConfService.deleteByPk(inPluginCountersignConfVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键更新信息
	 * @param inPluginCountersignConfVo
	 * @return
	 */
	@RequestMapping(value="/plugin/countersign/conf", method=RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody PluginCountersignConfVO inPluginCountersignConfVo) {		
		int outputVo = pluginCountersignConfService.updateByPk(inPluginCountersignConfVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 新增数据
	 * @param inPluginCountersignConfVo
	 * @return
	 */
	@RequestMapping(value="/plugin/countersign/conf", method=RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertPluginCountersignConf(@RequestBody PluginCountersignConfVO inPluginCountersignConfVo) {
		int outputVo = pluginCountersignConfService.insertPluginCountersignConf(inPluginCountersignConfVo);
		return getResponseData(outputVo);
		
	}
}
